package cn.edu.bupt.ch6_2.service;

import cn.edu.bupt.ch6_2.dto.ProductWithComments;
import cn.edu.bupt.ch6_2.entity.Product;

import java.io.Serializable;
import java.util.List;


public interface IProductService {

    public List<Product> findAll();
    public int create(Product product);
    public Product findById(Long id);
    public int updateReturnInt(Product product);
    public Product updateReturnProduct(Product product);
    public int deleteById(Long id);

    //一对多级联----嵌套Select查询方案示例
    public List<ProductWithComments> findByNameWithComments(String name);
    //一对多级联----嵌套 结果映射方案示例
    public List<ProductWithComments> findByNameWithCommentsV2(String name);
}
